package com.jit.monitor.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jit.monitor.R;
import com.jit.monitor.model.bean.AlarmBean;

import java.util.List;

/**
 * @author crazyZhangxl on 2019/1/15.
 * Describe:
 */
public class AlarmAdapter extends BaseQuickAdapter<AlarmBean,BaseViewHolder>{

    public AlarmAdapter(int layoutResId, @Nullable List<AlarmBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AlarmBean item) {
        ImageView ivIcon = helper.getView(R.id.ivIcon);
        ivIcon.setImageResource(item.getImageSource());
        helper.setText(R.id.tvName,item.getName());
        helper.setVisible(R.id.ivSelected,item.isState());
    }
}
